'use strict';
angular.module('nec-admin.user')
    .service('passwordService', ['$http', 'serverUrl', 'userService', function($http, serverUrl, userService){
        var service = this;

        //修改密码
        service.modifyPassword = function (oldPassword, newPassword) {
            return $http({
                url: serverUrl + '/password',
                method: 'PUT',
                data: {
                    userId: userService.getUserId(),
                    oldPassword: oldPassword,
                    newPassword: newPassword
                }
            });
        };
    }]);
